{extend name="layout/layout"}
{block name="content"}
<main class="user_page  ">
    <section class="">
        <div class="layui-main">
            <div class="user_con">
                <div class="user_headpage" data-load="user_active_header">
                    {include file="user_activity/page_menu" menu='type' id="$id" /}
                </div>
                <div class="right_main ">

                    <p class="ft24 mb10 ft-bold">活動類別</p>
                    <p class="ft14 gary_c9 mb20 ft-bold">選擇的類別越精準，感興趣的潛在消費者更容易看見你的活動</p>
                    <div class="block_com" style="min-height: 80vh;">
                        <div class="active_w1 active3 " style="margin:  0 auto;">
                            <from class="layui-form activity-type">
                                <p class="text-align-center ft18 mb40 ft-bold">選擇活動類型</p>
                                <div class="">
                                    <ul class="layui-row layui-col-space20 ul_height a5_ul1 active_ul ">
                                        {foreach $typeList as $type}
                                        <li class="layui-col-md2 layui-col-xs3">
                                            <div class="item {if $type.id==$act.type_id}active{/if}" data-id="{$type.id}">
                                                <p>{$type.name}</p>
                                            </div>
                                        </li>
                                        {/foreach}
                                    </ul>
                                </div>
                                <div class="mt40 d-flex jc-s al-c">


                                    <button class="layui-btn layui-btn-lg w100 layui-bg-orange next-btn" onclick="save()">储存</button>

                                </div>
                            </from>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
</main>

<script>
    function save() {
        var selected = $('.activity-type .active').data('id');
        $.quickPost('/activity/user/activity/{$id}/type', {type: selected})
    }
</script>
{/block}
